﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Website._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"
         DataKeyNames="BookID" AutoGenerateColumns="False"
          AllowPaging="True" AllowSorting="true" PageSize="5" 
           OnPageIndexChanging="ChangePage" OnSorting="SortRecords" 
        style="margin-left: 0px" Width="920px">
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#EFF3FB" />
            <EditRowStyle BackColor="#2ff1BF" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="BookID" HeaderText="Book ID" ReadOnly="True"  SortExpression="BookID" />
                <asp:TemplateField HeaderText="Title" SortExpression="Title">
                    <ItemTemplate>
                       <a href='/Book.aspx?bookid=<%# Eval("BookID") %>'><%# Eval("Title") %>
</a> 
                                           </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtTitle" runat="Server" Text='<%# Eval("Title") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Author" SortExpression="Author">
                    <ItemTemplate>
                        <%# Eval("Author") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtAuthor" runat="Server" Text='<%# Eval("Author") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Year" SortExpression="Year">
                    <ItemTemplate>
                        <%# Eval("Year") %>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtYear" runat="Server" Text='<%# Eval("Year") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Availability" SortExpression="Availability">
                    <ItemTemplate>
                        <asp:CheckBox ID="cbAvailability" Enabled="false" runat="server" Checked='<%# Eval("Availability") %>'></asp:CheckBox>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtYear" runat="Server" Text='<%# Eval("Availability") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                
            </Columns>
        </asp:GridView>
</asp:Content>
